<?php
/**@var \Weline\Framework\View\Template $this */
?>
<header id="page-topbar">
    <div class="navbar-header">
        <div class="d-flex">
            <!-- LOGO -->
            <div class="navbar-brand-box text-center">
                <a href="@admin-url('admin')" class="logo logo-dark">
                                <span class="logo-sm">
                                    <img src="@static(Weline_Admin::assets/images/logo-sm.png)" alt="logo-sm-dark"
                                         height="50">
                                </span>
                    <span class="logo-lg">
                                    <img src="@static(Weline_Admin::assets/images/logo-dark.png)" alt="logo-dark"
                                         height="70">
                                </span>
                </a>

                <a href="<?= $this->request->getBackendUrl('admin') ?>" class="logo logo-light">
                                <span class="logo-sm">
                                    <img src="@static(Weline_Admin::assets/images/logo-sm.png)" alt="logo-sm-light"
                                         height="50">
                                </span>
                    <span class="logo-lg">
                                    <img src="@static(Weline_Admin::assets/images/logo-light.png)" alt="logo-light"
                                         height="70">
                                </span>
                </a>
            </div>

            <button type="button" class="btn btn-sm px-3 font-size-24 header-item waves-effect" id="vertical-menu-btn">
                <i class="ri-menu-2-line align-middle"></i>
            </button>

            <!-- App Search-->
            <form class="app-search d-none d-lg-block">
                <div class="position-relative">
                    <input type="text" class="form-control" placeholder="<?= __('搜索 ...') ?>">
                    <span class="ri-search-line"></span>
                </div>
            </form>
        </div>

        <div class="d-flex">

            <div class="dropdown d-inline-block d-lg-none ms-2">
                <button type="button" class="btn header-item noti-icon waves-effect" id="page-header-search-dropdown"
                        data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <i class="ri-search-line"></i>
                </button>
                <div class="dropdown-menu dropdown-menu-lg dropdown-menu-end p-0"
                     aria-labelledby="page-header-search-dropdown">

                    <form class="p-3">
                        <div class="mb-3 m-0">
                            <div class="input-group">
                                <input type="text" class="form-control" placeholder="<?= __('搜索 ...') ?>">
                                <div class="input-group-append">
                                    <button class="btn btn-primary" type="submit"><i class="ri-search-line"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

            <div class="dropdown d-none d-sm-inline-block">
                <button type="button" class="btn header-item waves-effect"
                        data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <img class="" src="@static(Weline_Admin::assets/images/flags/zh_CN.jfif)" alt="<?= __('头部语言') ?>"
                         height="16">
                </button>
                <div class="dropdown-menu dropdown-menu-end">
                    <!-- item-->
                    <a href='javascript:void(0);' class='dropdown-item notify-item'>
                        <img src='@static(Weline_Admin::assets/images/flags/zh_CN.jfif)' alt='user-image' class='me-1'
                             height='12'> <span class='align-middle'><?= __('中国') ?></span>
                    </a>
                    <!-- item-->
                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                        <img src="@static(Weline_Admin::assets/images/flags/spain.jpg)" alt="user-image" class="me-1"
                             height="12"> <span class="align-middle">Spanish</span>
                    </a>

                    <!-- item-->
                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                        <img src="@static(Weline_Admin::assets/images/flags/germany.jpg)" alt="user-image" class="me-1"
                             height="12"> <span class="align-middle">German</span>
                    </a>

                    <!-- item-->
                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                        <img src="@static(Weline_Admin::assets/images/flags/italy.jpg)" alt="user-image" class="me-1"
                             height="12"> <span class="align-middle">Italian</span>
                    </a>

                    <!-- item-->
                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                        <img src="@static(Weline_Admin::assets/images/flags/russia.jpg)" alt="user-image" class="me-1"
                             height="12"> <span class="align-middle">Russian</span>
                    </a>
                </div>
            </div>

            <div class="dropdown d-none d-lg-inline-block ms-1">
                <button type="button" class="btn header-item noti-icon waves-effect"
                        data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <i class="ri-apps-2-line"></i>
                </button>
                <div class="dropdown-menu dropdown-menu-lg dropdown-menu-end">
                    <div class="px-lg-2">
                        <div class="row g-0">
                            <div class="col">
                                <a class="dropdown-icon-item" href="#">
                                    <img src="@static(Weline_Admin::assets/images/brands/github.png)" alt="Github">
                                    <span>GitHub</span>
                                </a>
                            </div>
                            <div class="col">
                                <a class="dropdown-icon-item" href="#">
                                    <img src="@static(Weline_Admin::assets/images/brands/bitbucket.png)"
                                         alt="bitbucket">
                                    <span>Bitbucket</span>
                                </a>
                            </div>
                            <div class="col">
                                <a class="dropdown-icon-item" href="#">
                                    <img src="@static(Weline_Admin::assets/images/brands/dribbble.png)" alt="dribbble">
                                    <span>Dribbble</span>
                                </a>
                            </div>
                        </div>

                        <div class="row g-0">
                            <div class="col">
                                <a class="dropdown-icon-item" href="#">
                                    <img src="@static(Weline_Admin::assets/images/brands/dropbox.png)" alt="dropbox">
                                    <span>Dropbox</span>
                                </a>
                            </div>
                            <div class="col">
                                <a class="dropdown-icon-item" href="#">
                                    <img src="@static(Weline_Admin::assets/images/brands/mail_chimp.png)"
                                         alt="mail_chimp">
                                    <span>Mail Chimp</span>
                                </a>
                            </div>
                            <div class="col">
                                <a class="dropdown-icon-item" href="#">
                                    <img src="@static(Weline_Admin::assets/images/brands/slack.png)" alt="slack">
                                    <span>Slack</span>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="dropdown d-none d-lg-inline-block ms-1">
                <button type="button" class="btn header-item noti-icon waves-effect" data-toggle="fullscreen">
                    <i class="ri-fullscreen-line"></i>
                </button>
            </div>
            <!--通知 开始-->

            <w:block class='Weline\Admin\Block\System\Notification'/>

            <!--通知 结束-->

            <div class="dropdown d-inline-block user-dropdown">
                <?php
                /**@var \Weline\Admin\Block\Backend\Page\Topbar $topbar */
                $topbar = \Weline\Framework\Manager\ObjectManager::getInstance(\Weline\Admin\Block\Backend\Page\Topbar::class);
                ?>
                <button type="button" class="btn header-item waves-effect" id="page-header-user-dropdown"
                        data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <img class="rounded-circle header-profile-user"
                         src="<?= $topbar->getAvatar() ?>"
                         alt="<?= __('头像') ?>">
                    <span class="d-none d-xl-inline-block ms-1"><?= $topbar->getUser()->getUsername() ?></span>
                    <i class="mdi mdi-chevron-down d-none d-xl-inline-block"></i>
                </button>
                <div class="dropdown-menu dropdown-menu-end">
                    <!-- item-->
                    <a class="dropdown-item" href="#"><i class="ri-user-line align-middle me-1"></i><?= __('资料') ?></a>
                    <a class="dropdown-item" href="#"><i
                                class="ri-wallet-2-line align-middle me-1"></i> <?= __('我的钱包') ?></a>
                    <a class="dropdown-item d-block" href="#"><span class="badge bg-success float-end mt-1">11</span><i
                                class="ri-settings-2-line align-middle me-1"></i> <?= __('设置') ?></a>
                    <a class="dropdown-item" href="#"><i
                                class="ri-lock-unlock-line align-middle me-1"></i> <?= __('锁定屏幕') ?></a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item text-danger" href="<?= $this->getBackendUrl('admin/login/logout') ?>"><i
                                class="ri-shut-down-line align-middle me-1 text-danger"></i> <?= __('退出') ?></a>
                </div>
            </div>

            <div class="dropdown d-inline-block">
                <button type="button" class="btn header-item noti-icon right-bar-toggle waves-effect">
                    <i class="mdi mdi-cog"></i>
                </button>
            </div>

        </div>
    </div>
</header>